import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex);

  const SEQUENCE_MODE = 1; //列表循环
  const RANDOM_MOD = 2; //随机循环
  const SINGLE_CYCLE_MOD = 3; // 单曲循环
  
const store = new vuex.Store({
    state: {
        info: {
            portrait: '',
            nickname: '',
            mobile: '',
            status: '',
            create_time: '',
        },
        currentIndex: 0,
        songlist: [],
        playMod: SEQUENCE_MODE,
        closetimecurrent: 0
    },
    mutations: {
        setinfo(state, info) {
            state.info = info;
        },
        setmobile(state, mobile) {
            state.info.mobile = mobile;
        },
        setCurrentIndex(state, currentIndex){
            state.currentIndex = currentIndex;
        },
        setSonglist(state, songlist){
            state.songlist = songlist;
        },
        setPlayMod(state, playMod) {
          state.playMod = playMod;
        },
        setClosetimecurrent(state, closetimecurrent) {
          state.closetimecurrent = closetimecurrent;
        }
    }
})

export default store